{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "832f4114-39d6-4b1c-a4be-5eb0989ef814",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "plt.rcParams[\"font.sans-serif\"] = \"SimHei\"\n",
    "plt.rcParams[\"axes.unicode_minus\"] = False\n",
    "pd.set_option(\"display.float_format\", lambda x: \"%.3f\" % x) #设置不显示科学计数法\n",
    "pd.set_option('display.float_format', '{:.6f}'.format) # 禁止值显示舍入\n",
    "import seaborn as sns\n",
    "import warnings\n",
    "warnings.filterwarnings(\"ignore\")\n",
    "from sklearn.model_selection import train_test_split\n",
    "from sklearn.preprocessing import MinMaxScaler\n",
    "from sklearn.tree import DecisionTreeRegressor\n",
    "from sklearn.linear_model import LinearRegression,LogisticRegression\n",
    "from sklearn.ensemble import RandomForestRegressor,RandomForestClassifier,GradientBoostingClassifier,GradientBoostingRegressor\n",
    "from sklearn.metrics import accuracy_score,precision_score,recall_score,f1_score,mean_squared_error,roc_auc_score\n",
    "# from xgboost import XGBRegressor\n",
    "# from lightgbm import LGBMRegressor\n",
    "import time"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "f4825af8-04b2-4faf-9c49-2b5e1e273d2d",
   "metadata": {},
   "source": [
    "# 数据导入"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e47c799d-56f8-4785-add8-b60452d8c6e1",
   "metadata": {},
   "source": [
    "## 导入train数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "9a92b907-fd2e-47cf-9878-9d8efa19aaa2",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "train_data = pd.read_csv(\"./data/tap4fun原始数据/tap4fun竞赛数据/tap_fun_train.csv\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "3c3a434e-ef64-4a29-8add-c31cab3a22fb",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>user_id</th>\n",
       "      <th>register_time</th>\n",
       "      <th>wood_add_value</th>\n",
       "      <th>wood_reduce_value</th>\n",
       "      <th>stone_add_value</th>\n",
       "      <th>stone_reduce_value</th>\n",
       "      <th>ivory_add_value</th>\n",
       "      <th>ivory_reduce_value</th>\n",
       "      <th>meat_add_value</th>\n",
       "      <th>meat_reduce_value</th>\n",
       "      <th>...</th>\n",
       "      <th>pvp_battle_count</th>\n",
       "      <th>pvp_lanch_count</th>\n",
       "      <th>pvp_win_count</th>\n",
       "      <th>pve_battle_count</th>\n",
       "      <th>pve_lanch_count</th>\n",
       "      <th>pve_win_count</th>\n",
       "      <th>avg_online_minutes</th>\n",
       "      <th>pay_price</th>\n",
       "      <th>pay_count</th>\n",
       "      <th>prediction_pay_price</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>2018-02-02 19:47:15</td>\n",
       "      <td>20125.000000</td>\n",
       "      <td>3700.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>16375.000000</td>\n",
       "      <td>2000.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.333333</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1593</td>\n",
       "      <td>2018-01-26 00:01:05</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.333333</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1594</td>\n",
       "      <td>2018-01-26 00:01:58</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1.166667</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1595</td>\n",
       "      <td>2018-01-26 00:02:13</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>3.166667</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1596</td>\n",
       "      <td>2018-01-26 00:02:46</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>2.333333</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 109 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "   user_id        register_time  wood_add_value  wood_reduce_value  \\\n",
       "0        1  2018-02-02 19:47:15    20125.000000        3700.000000   \n",
       "1     1593  2018-01-26 00:01:05        0.000000           0.000000   \n",
       "2     1594  2018-01-26 00:01:58        0.000000           0.000000   \n",
       "3     1595  2018-01-26 00:02:13        0.000000           0.000000   \n",
       "4     1596  2018-01-26 00:02:46        0.000000           0.000000   \n",
       "\n",
       "   stone_add_value  stone_reduce_value  ivory_add_value  ivory_reduce_value  \\\n",
       "0         0.000000            0.000000         0.000000            0.000000   \n",
       "1         0.000000            0.000000         0.000000            0.000000   \n",
       "2         0.000000            0.000000         0.000000            0.000000   \n",
       "3         0.000000            0.000000         0.000000            0.000000   \n",
       "4         0.000000            0.000000         0.000000            0.000000   \n",
       "\n",
       "   meat_add_value  meat_reduce_value  ...  pvp_battle_count  pvp_lanch_count  \\\n",
       "0    16375.000000        2000.000000  ...                 0                0   \n",
       "1        0.000000           0.000000  ...                 0                0   \n",
       "2        0.000000           0.000000  ...                 0                0   \n",
       "3        0.000000           0.000000  ...                 0                0   \n",
       "4        0.000000           0.000000  ...                 0                0   \n",
       "\n",
       "   pvp_win_count  pve_battle_count  pve_lanch_count  pve_win_count  \\\n",
       "0              0                 0                0              0   \n",
       "1              0                 0                0              0   \n",
       "2              0                 0                0              0   \n",
       "3              0                 0                0              0   \n",
       "4              0                 0                0              0   \n",
       "\n",
       "   avg_online_minutes  pay_price  pay_count  prediction_pay_price  \n",
       "0            0.333333   0.000000          0              0.000000  \n",
       "1            0.333333   0.000000          0              0.000000  \n",
       "2            1.166667   0.000000          0              0.000000  \n",
       "3            3.166667   0.000000          0              0.000000  \n",
       "4            2.333333   0.000000          0              0.000000  \n",
       "\n",
       "[5 rows x 109 columns]"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "train_data.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e3d2ae98-36b3-4603-874c-c5801f86a54d",
   "metadata": {},
   "source": [
    "## 导入test数据-此test为最终提交的文件，非训练时候的test"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "aaa39d57-7efd-4513-a8de-89d6c82e8bcb",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "test_data = pd.read_csv(\"./data/tap4fun原始数据/tap4fun竞赛数据/tap_fun_test.csv\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "cbf5ba36-b2e2-469c-8e99-94f8d84ade9b",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>user_id</th>\n",
       "      <th>register_time</th>\n",
       "      <th>wood_add_value</th>\n",
       "      <th>wood_reduce_value</th>\n",
       "      <th>stone_add_value</th>\n",
       "      <th>stone_reduce_value</th>\n",
       "      <th>ivory_add_value</th>\n",
       "      <th>ivory_reduce_value</th>\n",
       "      <th>meat_add_value</th>\n",
       "      <th>meat_reduce_value</th>\n",
       "      <th>...</th>\n",
       "      <th>sr_rss_help_bonus_level</th>\n",
       "      <th>pvp_battle_count</th>\n",
       "      <th>pvp_lanch_count</th>\n",
       "      <th>pvp_win_count</th>\n",
       "      <th>pve_battle_count</th>\n",
       "      <th>pve_lanch_count</th>\n",
       "      <th>pve_win_count</th>\n",
       "      <th>avg_online_minutes</th>\n",
       "      <th>pay_price</th>\n",
       "      <th>pay_count</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>14933</td>\n",
       "      <td>2018-03-08 20:27:57</td>\n",
       "      <td>166415.000000</td>\n",
       "      <td>138362.000000</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>258522</td>\n",
       "      <td>90142</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>8.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>14934</td>\n",
       "      <td>2018-03-08 20:29:42</td>\n",
       "      <td>10000.000000</td>\n",
       "      <td>600.000000</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>10000</td>\n",
       "      <td>400</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.166667</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>14935</td>\n",
       "      <td>2018-03-08 20:30:13</td>\n",
       "      <td>10000.000000</td>\n",
       "      <td>3700.000000</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>10000</td>\n",
       "      <td>2000</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>17.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>14936</td>\n",
       "      <td>2018-03-08 20:31:41</td>\n",
       "      <td>210000.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>200000</td>\n",
       "      <td>0</td>\n",
       "      <td>200000</td>\n",
       "      <td>0</td>\n",
       "      <td>610000</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1.666667</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>14937</td>\n",
       "      <td>2018-03-08 20:32:07</td>\n",
       "      <td>11500.000000</td>\n",
       "      <td>3700.000000</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>11000</td>\n",
       "      <td>2000</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.333333</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 108 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "   user_id        register_time  wood_add_value  wood_reduce_value  \\\n",
       "0    14933  2018-03-08 20:27:57   166415.000000      138362.000000   \n",
       "1    14934  2018-03-08 20:29:42    10000.000000         600.000000   \n",
       "2    14935  2018-03-08 20:30:13    10000.000000        3700.000000   \n",
       "3    14936  2018-03-08 20:31:41   210000.000000           0.000000   \n",
       "4    14937  2018-03-08 20:32:07    11500.000000        3700.000000   \n",
       "\n",
       "   stone_add_value  stone_reduce_value  ivory_add_value  ivory_reduce_value  \\\n",
       "0                0                   0                0                   0   \n",
       "1                0                   0                0                   0   \n",
       "2                0                   0                0                   0   \n",
       "3           200000                   0           200000                   0   \n",
       "4                0                   0                0                   0   \n",
       "\n",
       "   meat_add_value  meat_reduce_value  ...  sr_rss_help_bonus_level  \\\n",
       "0          258522              90142  ...                        0   \n",
       "1           10000                400  ...                        0   \n",
       "2           10000               2000  ...                        0   \n",
       "3          610000                  0  ...                        0   \n",
       "4           11000               2000  ...                        0   \n",
       "\n",
       "   pvp_battle_count  pvp_lanch_count  pvp_win_count  pve_battle_count  \\\n",
       "0                 0                0              0                 1   \n",
       "1                 0                0              0                 0   \n",
       "2                 0                0              0                 0   \n",
       "3                 0                0              0                 0   \n",
       "4                 0                0              0                 0   \n",
       "\n",
       "   pve_lanch_count  pve_win_count  avg_online_minutes  pay_price  pay_count  \n",
       "0                1              1            8.000000   0.000000          0  \n",
       "1                0              0            0.166667   0.000000          0  \n",
       "2                0              0           17.000000   0.000000          0  \n",
       "3                0              0            1.666667   0.000000          0  \n",
       "4                0              0            0.333333   0.000000          0  \n",
       "\n",
       "[5 rows x 108 columns]"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "test_data.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "af4d3c18-935b-462e-ab84-ab10a74ea208",
   "metadata": {},
   "source": [
    "## 导入字段解释"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "86e413c0-249e-4d74-a3cd-2884bf221b3b",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "features_name = pd.read_excel(\"./data/tap4fun 数据字段解释.xlsx\",usecols=[\"字段名\",\"字段解释\",\"数据时间\",\"变量性质\"])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "c4447e2d-3a14-449a-93b8-505d759679eb",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>字段名</th>\n",
       "      <th>字段解释</th>\n",
       "      <th>数据时间</th>\n",
       "      <th>变量性质</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>user_id</td>\n",
       "      <td>玩家唯一ID</td>\n",
       "      <td>永久</td>\n",
       "      <td>ID</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>register_time</td>\n",
       "      <td>玩家注册时间</td>\n",
       "      <td>永久</td>\n",
       "      <td>自变量</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>wood_add_value</td>\n",
       "      <td>木头获取数量</td>\n",
       "      <td>前七日</td>\n",
       "      <td>自变量</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>wood_reduce_value</td>\n",
       "      <td>木头消耗数量</td>\n",
       "      <td>前七日</td>\n",
       "      <td>自变量</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>stone_add_value</td>\n",
       "      <td>石头获取数量</td>\n",
       "      <td>前七日</td>\n",
       "      <td>自变量</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>104</th>\n",
       "      <td>pve_win_count</td>\n",
       "      <td>PVE胜利次数</td>\n",
       "      <td>前七日</td>\n",
       "      <td>自变量</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>105</th>\n",
       "      <td>avg_online_minutes</td>\n",
       "      <td>在线时长</td>\n",
       "      <td>前七日</td>\n",
       "      <td>自变量</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>106</th>\n",
       "      <td>pay_price</td>\n",
       "      <td>付费金额</td>\n",
       "      <td>前七日</td>\n",
       "      <td>自变量</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>107</th>\n",
       "      <td>pay_count</td>\n",
       "      <td>付费次数</td>\n",
       "      <td>前七日</td>\n",
       "      <td>自变量</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>108</th>\n",
       "      <td>prediction_pay_price</td>\n",
       "      <td>45日付费金额</td>\n",
       "      <td>前45日</td>\n",
       "      <td>因变量</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>109 rows × 4 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                      字段名     字段解释  数据时间 变量性质\n",
       "0                 user_id   玩家唯一ID    永久   ID\n",
       "1           register_time   玩家注册时间    永久  自变量\n",
       "2          wood_add_value   木头获取数量   前七日  自变量\n",
       "3       wood_reduce_value   木头消耗数量   前七日  自变量\n",
       "4         stone_add_value   石头获取数量   前七日  自变量\n",
       "..                    ...      ...   ...  ...\n",
       "104         pve_win_count  PVE胜利次数   前七日  自变量\n",
       "105    avg_online_minutes     在线时长   前七日  自变量\n",
       "106             pay_price     付费金额   前七日  自变量\n",
       "107             pay_count     付费次数   前七日  自变量\n",
       "108  prediction_pay_price  45日付费金额  前45日  因变量\n",
       "\n",
       "[109 rows x 4 columns]"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "features_name"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "5b8c21dc-5b3f-4de5-affa-e69c27b07249",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "# 将列名改为中文\n",
    "train_data.columns = features_name[\"字段解释\"]\n",
    "test_data.columns = features_name[\"字段解释\"][:-1]"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "8500c76f-f57c-4d1b-923f-5130296102f9",
   "metadata": {
    "tags": []
   },
   "source": [
    "- ID为身份特征，不带入建模\n",
    "- 45日付费金额为标签列，其余列都为特征列"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "2a27f6d9-2610-44b8-89ff-00babdc97b1c",
   "metadata": {},
   "source": [
    "# 数据探索"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e6bedf76-1469-4688-a74d-e5008d5edf83",
   "metadata": {},
   "source": [
    "## 查看基本情况"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "bf93e487-eb9b-4604-8d2e-e5a377ac9a09",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 2288007 entries, 0 to 2288006\n",
      "Columns: 109 entries, 玩家唯一ID to 45日付费金额\n",
      "dtypes: float64(13), int64(95), object(1)\n",
      "memory usage: 1.9+ GB\n"
     ]
    }
   ],
   "source": [
    "train_data.info()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "d4c76500-8b23-4bfa-9f44-9c666339007c",
   "metadata": {},
   "source": [
    "- 109列，对计算机的计算资源要求比较高\n",
    "- 有一个object类型特征，要将之处理成数值型才可以建模"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "d7dfbdaf-d1c4-40f8-a994-477b9dedcaaf",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Index(['玩家注册时间'], dtype='object', name='字段解释')"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 查看object特征是什么\n",
    "train_data.describe(include=\"O\").columns"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "eb0490ce-3e3a-496d-ba0e-4b8ebc020025",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "# 将注册时间改为datetime类型\n",
    "train_data[\"玩家注册时间\"] = pd.to_datetime(train_data[\"玩家注册时间\"])\n",
    "test_data[\"玩家注册时间\"] = pd.to_datetime(test_data[\"玩家注册时间\"])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "97a6b5b7-5c93-4f83-a07e-f1ddb109041b",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['玩家唯一ID',\n",
       " '玩家注册时间',\n",
       " '木头获取数量',\n",
       " '木头消耗数量',\n",
       " '石头获取数量',\n",
       " '石头消耗数量',\n",
       " '象牙获取数量',\n",
       " '象牙消耗数量',\n",
       " '肉获取数量',\n",
       " '肉消耗数量',\n",
       " '魔法获取数量',\n",
       " '魔法消耗数量',\n",
       " '勇士招募数量',\n",
       " '勇士损失数量',\n",
       " '驯兽师招募数量',\n",
       " '驯兽师损失数量',\n",
       " '萨满招募数量',\n",
       " '萨满损失数量',\n",
       " '勇士伤兵产生数量',\n",
       " '勇士伤兵恢复数量',\n",
       " '驯兽师伤兵产生数量',\n",
       " '驯兽师伤兵恢复数量',\n",
       " '萨满伤兵产生数量',\n",
       " '萨满伤兵恢复数量',\n",
       " '通用加速获取数量',\n",
       " '通用加速使用数量',\n",
       " '建筑加速获取数量',\n",
       " '建筑加速使用数量',\n",
       " '科研加速获取数量',\n",
       " '科研加速使用数量',\n",
       " '训练加速获取数量',\n",
       " '训练加速使用数量',\n",
       " '治疗加速获取数量',\n",
       " '治疗加速使用数量',\n",
       " '建筑：士兵小屋等级',\n",
       " '建筑：治疗小井等级',\n",
       " '建筑：要塞等级',\n",
       " '建筑：据点传送门等级',\n",
       " '建筑：兵营等级',\n",
       " '建筑：治疗之泉等级',\n",
       " '建筑：智慧神庙等级',\n",
       " '建筑：联盟大厅等级',\n",
       " '建筑：仓库等级',\n",
       " '建筑：瞭望塔等级',\n",
       " '建筑：魔法幸运树等级',\n",
       " '建筑：战争大厅等级',\n",
       " '建筑：联盟货车等级',\n",
       " '建筑：占卜台等级',\n",
       " '建筑：祭坛等级',\n",
       " '建筑：冒险传送门等级',\n",
       " '科研：侦查等级',\n",
       " '科研：训练速度等级',\n",
       " '科研：守护者',\n",
       " '科研：巨兽驯兽师',\n",
       " '科研：吟唱者',\n",
       " '科研：勇士攻击',\n",
       " '科研：驯兽师攻击',\n",
       " '科研：萨满攻击',\n",
       " '科研：战斗大师',\n",
       " '科研：高阶巨兽骑兵',\n",
       " '科研：图腾大师',\n",
       " '科研：部队防御',\n",
       " '科研：勇士防御',\n",
       " '科研：驯兽师防御',\n",
       " '科研：萨满防御',\n",
       " '科研：勇士生命',\n",
       " '科研：驯兽师生命',\n",
       " '科研：萨满生命',\n",
       " '科研：狂战士',\n",
       " '科研：龙骑兵',\n",
       " '科研：神谕者',\n",
       " '科研：部队攻击',\n",
       " '科研：建造速度',\n",
       " '科研：资源保护',\n",
       " '科研：部队消耗',\n",
       " '科研：木材生产',\n",
       " '科研：石头生产',\n",
       " '科研：象牙生产',\n",
       " '科研：肉类生产',\n",
       " '科研：木材采集',\n",
       " '科研：石头采集',\n",
       " '科研：象牙采集',\n",
       " '科研：肉类采集',\n",
       " '科研：部队负重',\n",
       " '科研：魔法采集',\n",
       " '科研：魔法生产',\n",
       " '科研：据点耐久',\n",
       " '科研：据点二',\n",
       " '科研：医院容量',\n",
       " '科研：领土采集奖励',\n",
       " '科研：治疗速度',\n",
       " '科研：据点三',\n",
       " '科研：联盟行军速度',\n",
       " '科研：战斗行军速度',\n",
       " '科研：采集行军速度',\n",
       " '科研：据点四',\n",
       " '科研：增援部队容量',\n",
       " '科研：行军大小',\n",
       " '科研：资源帮助容量',\n",
       " 'PVP次数',\n",
       " '主动发起PVP次数',\n",
       " 'PVP胜利次数',\n",
       " 'PVE次数',\n",
       " '主动发起PVE次数',\n",
       " 'PVE胜利次数',\n",
       " '在线时长',\n",
       " '付费金额',\n",
       " '付费次数',\n",
       " '45日付费金额']"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "train_data.columns.tolist()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "d4cda342-7cc6-4366-bdc1-cde9e3d4fd1b",
   "metadata": {},
   "source": [
    "- ID属于玩家身份标识，不代入模型中\n",
    "- 玩家注册时间是玩家最基础的属性\n",
    "- PVP次数','主动发起PVP次数','PVP胜利次数','PVE次数','主动发起PVE次数','PVE胜利次数', '在线时长','付费金额','付费次数'这9个特征属于**玩家行为**特征\n",
    "- 除此之外所有特征都属于玩家的资源获取/占有\n",
    "- 不存在离散特征"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "70cf981d-e47c-437d-95a6-39b79af5a87f",
   "metadata": {},
   "source": [
    "## 缺失和重复检验"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "1f778e2c-3291-41ce-8707-7747d028f4ab",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 检查缺失\n",
    "train_data.isna().sum().sum()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "ca265c6c-90c3-4be4-831a-49d0f39b67be",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 检查重复\n",
    "train_data.duplicated().sum()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "d8d35f60-5d4e-47f9-b532-c3e8d3091fd4",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 玩家id是否有重复的、\n",
    "train_data.duplicated(subset=\"玩家唯一ID\").sum()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "4bb7c8d2-ac87-48b0-a2f7-d72d4b41282a",
   "metadata": {},
   "source": [
    "## 查看特征分布"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "862c9c6a-f7f3-456b-8703-5a68b5bf79fc",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>count</th>\n",
       "      <th>mean</th>\n",
       "      <th>std</th>\n",
       "      <th>min</th>\n",
       "      <th>25%</th>\n",
       "      <th>50%</th>\n",
       "      <th>75%</th>\n",
       "      <th>max</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>字段解释</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>玩家唯一ID</th>\n",
       "      <td>2288007.000000</td>\n",
       "      <td>1529543.498087</td>\n",
       "      <td>939939.279443</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>749992.500000</td>\n",
       "      <td>1419095.000000</td>\n",
       "      <td>2299006.500000</td>\n",
       "      <td>3190530.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>木头获取数量</th>\n",
       "      <td>2288007.000000</td>\n",
       "      <td>454306.858946</td>\n",
       "      <td>4958667.145589</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>42038.000000</td>\n",
       "      <td>153118.000000</td>\n",
       "      <td>1239962311.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>木头消耗数量</th>\n",
       "      <td>2288007.000000</td>\n",
       "      <td>369843.251757</td>\n",
       "      <td>3737720.037889</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>9830.000000</td>\n",
       "      <td>98557.000000</td>\n",
       "      <td>799587506.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>石头获取数量</th>\n",
       "      <td>2288007.000000</td>\n",
       "      <td>189778.773918</td>\n",
       "      <td>4670619.517189</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>1214869437.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>石头消耗数量</th>\n",
       "      <td>2288007.000000</td>\n",
       "      <td>137607.362720</td>\n",
       "      <td>3370166.355926</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>796237770.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>PVE胜利次数</th>\n",
       "      <td>2288007.000000</td>\n",
       "      <td>2.556749</td>\n",
       "      <td>11.847372</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>488.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>在线时长</th>\n",
       "      <td>2288007.000000</td>\n",
       "      <td>10.207490</td>\n",
       "      <td>38.959464</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.500000</td>\n",
       "      <td>1.833333</td>\n",
       "      <td>4.833333</td>\n",
       "      <td>2049.666667</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>付费金额</th>\n",
       "      <td>2288007.000000</td>\n",
       "      <td>0.534669</td>\n",
       "      <td>22.638354</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>7457.950000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>付费次数</th>\n",
       "      <td>2288007.000000</td>\n",
       "      <td>0.057707</td>\n",
       "      <td>0.709089</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>105.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>45日付费金额</th>\n",
       "      <td>2288007.000000</td>\n",
       "      <td>1.793146</td>\n",
       "      <td>88.463033</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>32977.810000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>108 rows × 8 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                 count           mean            std      min           25%  \\\n",
       "字段解释                                                                          \n",
       "玩家唯一ID  2288007.000000 1529543.498087  939939.279443 1.000000 749992.500000   \n",
       "木头获取数量  2288007.000000  454306.858946 4958667.145589 0.000000      0.000000   \n",
       "木头消耗数量  2288007.000000  369843.251757 3737720.037889 0.000000      0.000000   \n",
       "石头获取数量  2288007.000000  189778.773918 4670619.517189 0.000000      0.000000   \n",
       "石头消耗数量  2288007.000000  137607.362720 3370166.355926 0.000000      0.000000   \n",
       "...                ...            ...            ...      ...           ...   \n",
       "PVE胜利次数 2288007.000000       2.556749      11.847372 0.000000      0.000000   \n",
       "在线时长    2288007.000000      10.207490      38.959464 0.000000      0.500000   \n",
       "付费金额    2288007.000000       0.534669      22.638354 0.000000      0.000000   \n",
       "付费次数    2288007.000000       0.057707       0.709089 0.000000      0.000000   \n",
       "45日付费金额 2288007.000000       1.793146      88.463033 0.000000      0.000000   \n",
       "\n",
       "                   50%            75%               max  \n",
       "字段解释                                                     \n",
       "玩家唯一ID  1419095.000000 2299006.500000    3190530.000000  \n",
       "木头获取数量    42038.000000  153118.000000 1239962311.000000  \n",
       "木头消耗数量     9830.000000   98557.000000  799587506.000000  \n",
       "石头获取数量        0.000000       0.000000 1214869437.000000  \n",
       "石头消耗数量        0.000000       0.000000  796237770.000000  \n",
       "...                ...            ...               ...  \n",
       "PVE胜利次数       0.000000       1.000000        488.000000  \n",
       "在线时长          1.833333       4.833333       2049.666667  \n",
       "付费金额          0.000000       0.000000       7457.950000  \n",
       "付费次数          0.000000       0.000000        105.000000  \n",
       "45日付费金额       0.000000       0.000000      32977.810000  \n",
       "\n",
       "[108 rows x 8 columns]"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 特征数量太多，数据量太大，画图运算时间太长\n",
    "train_data.describe().T"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "be6e526a-0867-4156-a69c-f2c57d68e263",
   "metadata": {},
   "source": [
    "- 木头资源应该是比较容易获取的基础资源，但是中分位数的数量都很少，上四分位甚至还是0，那么必然存在用户流失现象，且比较严重。"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "59b0a210-ec62-476c-ab56-665e52e04984",
   "metadata": {},
   "source": [
    "# 数据分析"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "be09dc18-27e4-477d-a0db-e05a69da20d5",
   "metadata": {},
   "source": [
    "## 玩家付费金额分析"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "88449c06-c0f8-42e1-b1a4-db84ac196537",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "PayAmount_7 = train_data[\"付费金额\"] # 提取玩家前七天付费金额\n",
    "PayAmount_45 = train_data[\"45日付费金额\"] # 提取玩家45天付费金额"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "b3a84b6b-f0b4-43fb-a7f7-dd0bc2da689d",
   "metadata": {},
   "source": [
    "### 金额分布"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "1c067c97-62e4-48c5-bef8-bc1c62deb254",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th>字段解释</th>\n",
       "      <th>付费金额</th>\n",
       "      <th>45日付费金额</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>count</th>\n",
       "      <td>2288007.000000</td>\n",
       "      <td>2288007.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>mean</th>\n",
       "      <td>0.534669</td>\n",
       "      <td>1.793146</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>std</th>\n",
       "      <td>22.638354</td>\n",
       "      <td>88.463033</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>min</th>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25%</th>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50%</th>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75%</th>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>80%</th>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>90%</th>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>95%</th>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>96%</th>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>97%</th>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>98%</th>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.990000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>99%</th>\n",
       "      <td>1.980000</td>\n",
       "      <td>3.970000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>max</th>\n",
       "      <td>7457.950000</td>\n",
       "      <td>32977.810000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "字段解释            付费金额        45日付费金额\n",
       "count 2288007.000000 2288007.000000\n",
       "mean        0.534669       1.793146\n",
       "std        22.638354      88.463033\n",
       "min         0.000000       0.000000\n",
       "25%         0.000000       0.000000\n",
       "50%         0.000000       0.000000\n",
       "75%         0.000000       0.000000\n",
       "80%         0.000000       0.000000\n",
       "90%         0.000000       0.000000\n",
       "95%         0.000000       0.000000\n",
       "96%         0.000000       0.000000\n",
       "97%         0.000000       0.000000\n",
       "98%         0.000000       0.990000\n",
       "99%         1.980000       3.970000\n",
       "max      7457.950000   32977.810000"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#  因为游戏经常会出现百分之十玩家养活百分百玩家的情况\n",
    "train_data[[\"付费金额\",\"45日付费金额\"]].describe([0.25,0.5,0.75,0.8,0.9,0.95,0.96,0.97,0.98,0.99])"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "b019ece9-98ca-467a-94c9-0106f3afa041",
   "metadata": {},
   "source": [
    "- 97%的用户都是没有付费过的，游戏行业最少百分之十的玩家养活整个游戏，玩家付费转化问题特别严峻。\n",
    "- 98%的用户都是都是付费不足一块钱，99%用户付费不足10块钱\n",
    "- 但是七天最大付费金额有7k，四十五天最大付费金额有3w。如果不是异常用户，那就是游戏本身还蛮吸引氪佬的。"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "673e6197-4e43-45f0-b842-5e861b113f97",
   "metadata": {},
   "source": [
    "### 氪金人数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "b60045c4-0083-4d79-a2e3-12866468b09c",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "玩家总数： 2288007\n",
      "前七天氪金玩家数量： 41439\n",
      "前七天氪金玩家占总玩家比率:1.811%\n"
     ]
    }
   ],
   "source": [
    "# 七天付费人数\n",
    "print(\"玩家总数：\",len(PayAmount_7))\n",
    "print(\"前七天氪金玩家数量：\",(PayAmount_7 > 0).sum())\n",
    "print(\"前七天氪金玩家占总玩家比率:{:.3f}%\".format(100 * (PayAmount_7 > 0).sum()/len(PayAmount_7)))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "4909f7a9-18e5-4cf6-94e8-2eb5a515cd82",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "玩家总数： 2288007\n",
      "四十五天氪金玩家数量： 45988\n",
      "四十五天氪金玩家占总玩家比率:2.010%\n"
     ]
    }
   ],
   "source": [
    "# 四十五天付费人数\n",
    "print(\"玩家总数：\",len(PayAmount_45))\n",
    "print(\"四十五天氪金玩家数量：\",(PayAmount_45 > 0).sum())\n",
    "print(\"四十五天氪金玩家占总玩家比率:{:.3f}%\".format(100 * (PayAmount_45 > 0).sum()/len(PayAmount_45)))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "cf711244-9ab2-471c-9d54-498be71f5f6c",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "玩家总数： 2288007\n",
      "前七天不付费，四十五天付费的玩家数量： 4549\n",
      "占前七天不付费玩家的比率:0.202%\n"
     ]
    }
   ],
   "source": [
    "# 前七天没有付费但是四十五天付费的玩家人数\n",
    "print(\"玩家总数：\",len(PayAmount_7))\n",
    "print(\"前七天不付费，四十五天付费的玩家数量：\",((PayAmount_7 == 0) & (PayAmount_45 != 0)).sum())\n",
    "print(\"占前七天不付费玩家的比率:{:.3f}%\".format(100 * ((PayAmount_7 == 0) & (PayAmount_45 != 0)).sum()/(PayAmount_7 == 0).sum()))"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "4736366a-b32e-4797-9c21-dcda4b076a7c",
   "metadata": {
    "tags": []
   },
   "source": [
    "- 有4549人即便前七天没有充钱，后面还是充钱了,说明游戏本身还是有吸引玩家付费的地方。\n",
    "- 前七天如果不付费，那么后续有99.8的几率也是不会付费。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "d4e5b53e-d112-4586-af49-5ecd57e434b9",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "前七天付费但是四十五天再也没有付费的玩家人数： 30130\n",
      "占前七天付费人数的比率：0.727%\n"
     ]
    }
   ],
   "source": [
    "print(\"前七天付费但是四十五天再也没有付费的玩家人数：\",PayAmount_45[(PayAmount_7 != 0)&(PayAmount_45 == PayAmount_7)].count())\n",
    "print(\"占前七天付费人数的比率：{:.3f}%\".format(PayAmount_45[(PayAmount_7 != 0)&(PayAmount_45 == PayAmount_7)].count()/(PayAmount_7 > 0).sum()))"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "a2d5c372-ce18-4275-a572-3d16ffe8395c",
   "metadata": {},
   "source": [
    "- 前七天付费玩家有七成可能在后续不再付费\n",
    "- 提出猜想：是后续再氪金的礼包没有性价比？"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "81737c83-b47c-4e92-a19d-802fc4025a16",
   "metadata": {},
   "source": [
    "### 氪金金额"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "30a7edff-1bfd-46af-a098-3636b6e0c76b",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "前七天氪金金额： 1223326.6600000004\n",
      "前七天人均付费（ARPU）： 0.5346691072186407\n",
      "前七天付费玩家人均付费（ARPPU） 29.52114336735926\n"
     ]
    }
   ],
   "source": [
    "print(\"前七天氪金金额：\",PayAmount_7.sum())\n",
    "print(\"前七天人均付费（ARPU）：\",PayAmount_7.sum()/len(PayAmount_7))\n",
    "print(\"前七天付费玩家人均付费（ARPPU）\",PayAmount_7.sum()/(PayAmount_7>0).sum())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "53534717-a5ee-49be-a924-c2be8e88eeed",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "四十五天氪金金额： 4102730.110000002\n",
      "四十五天人均付费（ARPU）： 1.7931457858302016\n",
      "四十五天付费玩家人均付费（ARPPU） 89.21305797164483\n"
     ]
    }
   ],
   "source": [
    "print(\"四十五天氪金金额：\",PayAmount_45.sum())\n",
    "print(\"四十五天人均付费（ARPU）：\",PayAmount_45.sum()/len(PayAmount_45))\n",
    "print(\"四十五天付费玩家人均付费（ARPPU）\",PayAmount_45.sum()/(PayAmount_45>0).sum())"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "45339cc9-7084-4f08-9b92-a2b7eaac98a8",
   "metadata": {},
   "source": [
    "- 前七天营收金额只有一百万，人均消费只有五毛钱，这对于一款新游戏来说是致命的，对于后续的运营都很难，如果一致都这个营收，肯定没法摆平成本。\n",
    "- 四十五天营收只有四百万。游戏是上线时候随着时间玩家留存会越来越少，四十五天只有四百万营收肯定是不允许继续运营下去的。\n",
    "- 前七天付费玩家人均贡献29元，四十五天的时候付费玩家人均贡献89元。证明游戏可玩性还是挺高的，礼包的性价比也乐于让玩家付费，否则氪金玩家不会氪金如此多。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "id": "5130f396-ecdc-46ff-812e-5a8353bd309f",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "count   11309.000000\n",
       "mean      315.963475\n",
       "std      1202.828424\n",
       "min         1.980000\n",
       "25%        16.940000\n",
       "50%        48.920000\n",
       "75%       163.760000\n",
       "max     32977.810000\n",
       "Name: 45日付费金额, dtype: float64"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 前七天氪金的后续继续氪金的玩家氪金金额\n",
    "PayAmount_45[(PayAmount_7 !=0)&(PayAmount_45 != PayAmount_7)].describe()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "id": "43fd168d-3253-4db0-982a-5e5a2d193c2e",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "count   30130.000000\n",
       "mean       11.407407\n",
       "std        71.134875\n",
       "min         0.990000\n",
       "25%         0.990000\n",
       "50%         1.980000\n",
       "75%         5.980000\n",
       "max      4086.520000\n",
       "Name: 45日付费金额, dtype: float64"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 前七天氪金的后续不再氪金的玩家氪金金额\n",
    "PayAmount_45[(PayAmount_7 !=0)&(PayAmount_45 == PayAmount_7)].describe()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e95d482b-6046-4482-84a9-0b52e14304fe",
   "metadata": {},
   "source": [
    "- 后续继续付费的玩家再前七天充钱的时候大部分都高于17块钱，而且价格也是比较可观的，而后续不再付费的玩家前七天付费大部分都是低于6块钱。\n",
    "- 提出猜想：是不是首充大礼包价格设置不合理，如果首充大礼包性价比过低，用户后续充钱的欲望会降低，但是首充大礼包性价比过高，玩家后续付费的欲望也会降低。那么首充礼包性价比如何搭配？（数据能反映首充礼包性价比的特征只有付费金额）"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "b3442163-0df7-4f6c-9ec5-e1134506d8ff",
   "metadata": {},
   "source": [
    "- 一个玩家在前七天付费之后只有两种情况：后续不再付费和后续继续付费。后续继续付费的概率记忆后续不再付费的概率和为1。那么首充大礼包的价钱就会影响到玩家后续付费的概率。\n",
    "- 当首充价钱太低或者太高，后续玩家继续付费的概率如何确定呢？是否可以通过人数来确定，如果首充大礼包价格为N，购买首充大礼包的用户为A,后续继续氪金的用户数量为B,那么后续不再氪金的用户为A-B，那么后续继续氪金的概率是B/A,后续不再氪金的概率为(A-B)/A。一定存在一个首充大礼包金额N，令后续继续氪金的概率大于后续不再氪金的概率。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "id": "703b6196-5238-4708-8186-27155dddf69d",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "# 首充大礼包加钱应该不会太高，初步假定低于30\n",
    "p = [] # 后续继续付费的概率\n",
    "nop = [] # 后续不再付费的概率\n",
    "for n in range(1,31):\n",
    "    # 首充付费超过n元的用户\n",
    "    all_ = PayAmount_7[PayAmount_7 > n]\n",
    "    # 后续继续付费的用户\n",
    "    P_all = all_[PayAmount_7 != PayAmount_45]\n",
    "    # 后续不再付费的用户\n",
    "    noP_all = all_[PayAmount_7 == PayAmount_45]\n",
    "    # 后续继续付费的概率\n",
    "    p.append(len(P_all)/len(all_))\n",
    "    # 后续不再付费的比例\n",
    "    nop.append(len(noP_all)/len(all_))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "id": "cbcb47c5-df00-4052-a19d-13e3c4d112c1",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAlcAAAEtCAYAAAAlakW+AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAABOt0lEQVR4nO3dd3hUVf7H8fdJgRBCJwSQJtIE6REQURDpTUSxl9VFVECWH6yLa10bFhQ7LEixF3RVUEApghApmkhAEOlFSiAJEAiQhCTn98cNIQkTmAwhN+Xzep77zM3MvSffmRySD7ecY6y1iIiIi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sgTipekrHc7EMbpw4HLwUmkjHWmBvvCbgMpyP+Djx/Ht+/HM4/jqU41zBc5GM744BB5/lZtAPW4/xhWACE+NjO08Cd+fFzwTnl9M8s7d7m68/2PH7Wp2rxuQ9naeO8+rCn95DX95WllvPqw1na8bkPZ639fPpwllp87sM5aslTH8a5gH0Rpy8u9qnf5tbH8vIz9tDGU770W0+15LXvnu3fTD68pzz1XQ9t3O1Lv83lc8lT3/XQxlhf+m0uteS1744F7spYfyvjc/Hpd25+LRpEVOQCMcYssdZ2McaUB5bh/OHqjXMnTL5c/yeSX4wxD+L8gT11BGUGMBr1WynkMm4imgmUBtYB/8YJnK71XYUrkQKQ8Y+/O7DUOtdHiBR66rdSVLnddxWuRERERPKRLmgXERERyUcKVyIiIiL5SOFKREREJB8pXImIiIjkI4UrERERkXz0/87CJH6+IiGnAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 720x360 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.figure(figsize=(10,5))\n",
    "plt.plot([*range(1,31)],p,color=\"red\")\n",
    "plt.plot([*range(1,31)],nop,color=\"green\")\n",
    "plt.legend([\"后续继续付费\",\"后续不再付费\"])\n",
    "plt.xticks([*range(1,31)])\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e9c323dc-18e0-4764-a8f6-4ece9404b25e",
   "metadata": {},
   "source": [
    "- 大概在5-6元之间存在一个金额，使得后续付费概率大于后续不付费概率。\n",
    "- 但是考虑到付费金额过高玩家也会不购买首充礼包，比较每个人的消费承受限度不一样，商人只赚取有限的利润，最好设置首充金额不要超过临界点太多。可以设置首充金额为6、7、8、9、10就好了。"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "51687aa3-781b-4229-9597-ac06f863426f",
   "metadata": {},
   "source": [
    "### 重氪玩家"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "id": "e4412e31-6ed7-4d8e-92f4-a7dca4688088",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "前七天氪金玩家贡献前100的贡献占比： 0.21562469667750062\n",
      "前七天氪金玩家贡献前500的贡献占比： 0.45210711748896226\n",
      "前七天氪金玩家贡献前1000的贡献占比： 0.5723122228040055\n",
      "前七天氪金玩家贡献前5000的贡献占比： 0.830021255320308\n"
     ]
    }
   ],
   "source": [
    "print(\"前七天氪金玩家贡献前100的贡献占比：\",PayAmount_7.sort_values(ascending=False)[:100].sum()/PayAmount_7.sum())\n",
    "print(\"前七天氪金玩家贡献前500的贡献占比：\",PayAmount_7.sort_values(ascending=False)[:500].sum()/PayAmount_7.sum())\n",
    "print(\"前七天氪金玩家贡献前1000的贡献占比：\",PayAmount_7.sort_values(ascending=False)[:1000].sum()/PayAmount_7.sum())\n",
    "print(\"前七天氪金玩家贡献前5000的贡献占比：\",PayAmount_7.sort_values(ascending=False)[:5000].sum()/PayAmount_7.sum())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "id": "f7422909-8ae8-4371-92e3-8f3b35c018bb",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "四十五天氪金玩家贡献前100的贡献占比： 0.24079305572454524\n",
      "四十五天氪金玩家贡献前500的贡献占比： 0.5161848118739643\n",
      "四十五天氪金玩家贡献前1000的贡献占比： 0.648779112599244\n",
      "四十五天氪金玩家贡献前5000的贡献占比： 0.8937514927103011\n"
     ]
    }
   ],
   "source": [
    "print(\"四十五天氪金玩家贡献前100的贡献占比：\",PayAmount_45.sort_values(ascending=False)[:100].sum()/PayAmount_45.sum())\n",
    "print(\"四十五天氪金玩家贡献前500的贡献占比：\",PayAmount_45.sort_values(ascending=False)[:500].sum()/PayAmount_45.sum())\n",
    "print(\"四十五天氪金玩家贡献前1000的贡献占比：\",PayAmount_45.sort_values(ascending=False)[:1000].sum()/PayAmount_45.sum())\n",
    "print(\"四十五天氪金玩家贡献前5000的贡献占比：\",PayAmount_45.sort_values(ascending=False)[:5000].sum()/PayAmount_45.sum())"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "d6cb0c0c-1e5c-4b78-88b9-2e15a392e9b7",
   "metadata": {},
   "source": [
    "- 再次印证游戏本身的可玩性是存在的，不是“无双割草”的无脑游戏，不然不会有如此重度氪金的玩家"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "2fbdefa6-7cf8-4cc8-afc0-b701cd45c2ea",
   "metadata": {},
   "source": [
    "## 玩家在线时长分析"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "id": "c6e2f341-ce7a-4980-b89c-31285a29c4b5",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "count   2288007.000000\n",
       "mean         10.207490\n",
       "std          38.959464\n",
       "min           0.000000\n",
       "25%           0.500000\n",
       "50%           1.833333\n",
       "75%           4.833333\n",
       "max        2049.666667\n",
       "Name: 在线时长, dtype: float64"
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "train_data[\"在线时长\"].describe()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ff7ad963-90af-41c8-9940-eee64b03032c",
   "metadata": {},
   "source": [
    "- 最小值是0，下四分位数为0.5，最大值为2049。由于是前七天的数据，所以单位为秒或者小时的概率不大，故而推算单位为分钟\n",
    "- 上四分位数接近5分钟，但是作为一款模拟经营类游戏前七天的游玩时间只有5分钟，实在是说不过去。用户流失异常严重，可能有的用户都撑不到七天，刚注册完5分钟就已经退游戏了。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "id": "09db893c-d3e4-4ddb-83ca-e67f57395325",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "count   2288007.000000\n",
       "mean         10.207490\n",
       "std          38.959464\n",
       "min           0.000000\n",
       "50%           1.833333\n",
       "75%           4.833333\n",
       "80%           6.666667\n",
       "85%           9.333333\n",
       "90%          15.000000\n",
       "95%          41.333333\n",
       "96%          55.166667\n",
       "97%          75.500000\n",
       "98%         110.000000\n",
       "99%         183.656667\n",
       "max        2049.666667\n",
       "Name: 在线时长, dtype: float64"
      ]
     },
     "execution_count": 32,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "train_data[\"在线时长\"].describe([0.75,0.8,0.85,0.9,0.95,0.96,0.97,0.98,0.99])"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "11b51580-cb42-4d92-928a-0bebd88b3ca0",
   "metadata": {},
   "source": [
    "- 90%的玩家在七天内只游玩了15分钟，情况异常严重。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "id": "6304a38f-d9f9-4f4f-8ed0-18de6a343d34",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "count   41439.000000\n",
       "mean      140.187746\n",
       "std       149.972913\n",
       "min         0.000000\n",
       "25%        33.000000\n",
       "50%        88.833333\n",
       "75%       194.666667\n",
       "max      1674.666667\n",
       "Name: 在线时长, dtype: float64"
      ]
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 付费用户前七天的游玩时长\n",
    "train_data[train_data[\"付费金额\"] > 0][\"在线时长\"].describe()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e6ef4a17-c3f5-4488-ae8b-3b814fb50c7c",
   "metadata": {},
   "source": [
    "* 最小值有0，说明有人压根游玩时长不足一分钟就充钱了"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "id": "89d1f707-3edf-4bee-8670-635ef9e858ac",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "57"
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "train_data[((train_data[\"付费金额\"] > 0) & (train_data[\"在线时长\"] < 1))].shape[0]"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "74159200-ed53-412e-a66c-67607527dc79",
   "metadata": {},
   "source": [
    "* 有57个人不足一分钟就充钱了"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "id": "7d16a3a2-d224-4713-8c5e-1af85677cf29",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "count   57.000000\n",
       "mean    10.073333\n",
       "std     21.895536\n",
       "min      0.990000\n",
       "25%      0.990000\n",
       "50%      0.990000\n",
       "75%      4.990000\n",
       "max     99.990000\n",
       "Name: 付费金额, dtype: float64"
      ]
     },
     "execution_count": 35,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "train_data[((train_data[\"付费金额\"] > 0) & (train_data[\"在线时长\"] < 1))][\"付费金额\"].describe()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "afede7cb-6cf8-45fb-8a59-591809c73ff6",
   "metadata": {},
   "source": [
    "* 大约30+人无脑充钱0.99"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "id": "2c1377ba-217f-4b93-8988-c56a58cafc75",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.000000      1845645\n",
       "0.990000         1412\n",
       "1.990000          131\n",
       "4.990000           95\n",
       "1.980000           82\n",
       "5.980000           82\n",
       "2.980000           40\n",
       "9.990000           28\n",
       "10.980000          21\n",
       "3.970000           12\n",
       "6.970000            8\n",
       "7.970000            7\n",
       "15.970000           6\n",
       "10.970000           6\n",
       "25.970000           5\n",
       "99.990000           4\n",
       "19.990000           4\n",
       "6.980000            4\n",
       "14.980000           3\n",
       "36.960000           3\n",
       "16.960000           2\n",
       "49.990000           2\n",
       "21.950000           2\n",
       "13.950000           2\n",
       "56.950000           2\n",
       "2.970000            2\n",
       "30.970000           2\n",
       "19.980000           1\n",
       "100.980000          1\n",
       "69.980000           1\n",
       "12.960000           1\n",
       "20.980000           1\n",
       "16.970000           1\n",
       "26.970000           1\n",
       "199.980000          1\n",
       "15.950000           1\n",
       "17.960000           1\n",
       "141.880000          1\n",
       "9.980000            1\n",
       "105.970000          1\n",
       "8.970000            1\n",
       "19.970000           1\n",
       "281.920000          1\n",
       "36.950000           1\n",
       "26.950000           1\n",
       "115.960000          1\n",
       "90.940000           1\n",
       "65.960000           1\n",
       "11.970000           1\n",
       "24.970000           1\n",
       "5.960000            1\n",
       "19.960000           1\n",
       "14.970000           1\n",
       "18.950000           1\n",
       "39.980000           1\n",
       "34.970000           1\n",
       "315.930000          1\n",
       "20.960000           1\n",
       "86.950000           1\n",
       "Name: 付费金额, dtype: int64"
      ]
     },
     "execution_count": 36,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "train_data.loc[train_data[\"在线时长\"]<=7,\"付费金额\"].value_counts() "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "id": "a513abd7-994b-47e4-9995-80f7d26eeee0",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.000000       56\n",
       "5.980000        4\n",
       "0.990000        3\n",
       "81.920000       1\n",
       "2.980000        1\n",
       "1.980000        1\n",
       "11.960000       1\n",
       "121.900000      1\n",
       "3.970000        1\n",
       "31.950000       1\n",
       "21.950000       1\n",
       "26.940000       1\n",
       "1023.740000     1\n",
       "68.880000       1\n",
       "9.940000        1\n",
       "206.860000      1\n",
       "36.950000       1\n",
       "1061.750000     1\n",
       "25.970000       1\n",
       "361.850000      1\n",
       "19.930000       1\n",
       "196.880000      1\n",
       "4.950000        1\n",
       "23.960000       1\n",
       "19.940000       1\n",
       "2.970000        1\n",
       "87.810000       1\n",
       "Name: 付费金额, dtype: int64"
      ]
     },
     "execution_count": 37,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "train_data.loc[train_data[\"在线时长\"]>=1000,\"付费金额\"].value_counts() "
   ]
  },
  {
   "cell_type": "markdown",
   "id": "3797fd49-bc5c-4bf6-99e9-d23c4000b8e2",
   "metadata": {},
   "source": [
    "* 玩的少的不一定是不充钱，玩的多的不一定充钱的多\n",
    "* 对于游戏公司来说，如何通过时间来判断用户价值就显得尤为重要，单个指标不能判断，就使用两个指标，从时间和金额两个指标来看"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "id": "fd30c517-9f8c-446c-bf14-5afdde225288",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "一周游玩时长低于 0 分钟的玩家贡献：\n",
      "前七天平均付费金额为： 2.3101155057752887e-05 付费总额为： 0.99 贡献率为：0.000%\n",
      "45天平均付费金额为： 0.04371181892427955 付费总额为： 1873.27 贡献率为：0.046%\n",
      "======分割线=======\n",
      "一周游玩时长低于 5 分钟的玩家贡献：\n",
      "前七天平均付费金额为： 0.0026768331801708977 付费总额为： 4631.429999999995 贡献率为：0.379%\n",
      "45天平均付费金额为： 0.019113149422896374 付费总额为： 33069.37999999999 贡献率为：0.806%\n",
      "======分割线=======\n",
      "一周游玩时长低于 10 分钟的玩家贡献：\n",
      "前七天平均付费金额为： 0.005756205051533579 付费总额为： 11342.320000000009 贡献率为：0.927%\n",
      "45天平均付费金额为： 0.022713119991312074 付费总额为： 44755.090000000004 贡献率为：1.091%\n",
      "======分割线=======\n",
      "一周游玩时长低于 15 分钟的玩家贡献：\n",
      "前七天平均付费金额为： 0.008977771394523073 付费总额为： 18502.72 贡献率为：1.512%\n",
      "45天平均付费金额为： 0.028161530518964768 付费总额为： 58039.44999999999 贡献率为：1.415%\n",
      "======分割线=======\n",
      "一周游玩时长低于 20 分钟的玩家贡献：\n",
      "前七天平均付费金额为： 0.012384384059210893 付费总额为： 26076.460000000014 贡献率为：2.132%\n",
      "45天平均付费金额为： 0.03767633995570023 付费总额为： 79331.00000000007 贡献率为：1.934%\n",
      "======分割线=======\n",
      "一周游玩时长低于 25 分钟的玩家贡献：\n",
      "前七天平均付费金额为： 0.016146993998664427 付费总额为： 34366.600000000006 贡献率为：2.809%\n",
      "45天平均付费金额为： 0.04455603589432284 付费总额为： 94831.24 贡献率为：2.311%\n",
      "======分割线=======\n",
      "一周游玩时长低于 30 分钟的玩家贡献：\n",
      "前七天平均付费金额为： 0.01915169523916157 付费总额为： 41088.43000000001 贡献率为：3.359%\n",
      "45天平均付费金额为： 0.05049773470929224 付费总额为： 108338.84999999998 贡献率为：2.641%\n",
      "======分割线=======\n"
     ]
    }
   ],
   "source": [
    "# 查看游玩时长短玩家付费金额贡献\n",
    "for i in range(0,31,5):\n",
    "    mean7 = train_data[train_data[\"在线时长\"] <= i][\"付费金额\"].mean()\n",
    "    mean45 = train_data[train_data[\"在线时长\"] <= i][\"45日付费金额\"].mean()\n",
    "    sum7 = train_data[train_data[\"在线时长\"] <= i][\"付费金额\"].sum()\n",
    "    sum45 = train_data[train_data[\"在线时长\"] <= i][\"45日付费金额\"].sum()\n",
    "    gx7 = sum7/(train_data[\"付费金额\"].sum())\n",
    "    gx45 = sum45/(train_data[\"45日付费金额\"].sum())\n",
    "    print(\"一周游玩时长低于\",i,\"分钟的玩家贡献：\")\n",
    "    print(\"前七天平均付费金额为：\",mean7,\"付费总额为：\",sum7,\"贡献率为：{:.3f}%\".format(gx7*100))\n",
    "    print(\"45天平均付费金额为：\",mean45,\"付费总额为：\",sum45,\"贡献率为：{:.3f}%\".format(gx45*100))\n",
    "    print(\"======分割线=======\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "7efd413b-9cc1-4dd1-a1a3-dd13c1cbc989",
   "metadata": {},
   "source": [
    "* 在线时长低的玩家贡献金额数量很少，仅有百分之2左右。可以将时长低于20的定义为低质量用户"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "id": "bbaa1eb6-4501-4b43-970d-69744796e0b9",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "一周游玩时长低于 400 分钟的玩家贡献：\n",
      "前七天平均付费金额为： 91.396295572916 付费总额为： 421154.13 贡献率为：34.427%\n",
      "45天平均付费金额为： 312.71993923610694 付费总额为： 1441013.48 贡献率为：35.123%\n",
      "======分割线=======\n",
      "一周游玩时长低于 500 分钟的玩家贡献：\n",
      "前七天平均付费金额为： 110.4915879097491 付费总额为： 259544.74000000002 贡献率为：21.216%\n",
      "45天平均付费金额为： 377.11326521924013 付费总额为： 885839.0599999999 贡献率为：21.591%\n",
      "======分割线=======\n",
      "一周游玩时长低于 600 分钟的玩家贡献：\n",
      "前七天平均付费金额为： 130.69889643463506 付费总额为： 153963.3 贡献率为：12.586%\n",
      "45天平均付费金额为： 437.75303056026985 付费总额为： 515673.07 贡献率为：12.569%\n",
      "======分割线=======\n",
      "一周游玩时长低于 700 分钟的玩家贡献：\n",
      "前七天平均付费金额为： 120.90376175548587 付费总额为： 77136.6 贡献率为：6.305%\n",
      "45天平均付费金额为： 427.77633228840085 付费总额为： 272921.30000000005 贡献率为：6.652%\n",
      "======分割线=======\n",
      "一周游玩时长低于 800 分钟的玩家贡献：\n",
      "前七天平均付费金额为： 104.343690851735 付费总额为： 33076.950000000004 贡献率为：2.704%\n",
      "45天平均付费金额为： 359.0403154574132 付费总额为： 113815.78 贡献率为：2.774%\n",
      "======分割线=======\n",
      "一周游玩时长低于 900 分钟的玩家贡献：\n",
      "前七天平均付费金额为： 43.818982035928116 付费总额为： 7317.77 贡献率为：0.598%\n",
      "45天平均付费金额为： 218.90658682634745 付费总额为： 36557.4 贡献率为：0.891%\n",
      "======分割线=======\n",
      "一周游玩时长低于 1000 分钟的玩家贡献：\n",
      "前七天平均付费金额为： 40.05540229885057 付费总额为： 3484.82 贡献率为：0.285%\n",
      "45天平均付费金额为： 139.19436781609193 付费总额为： 12109.909999999998 贡献率为：0.295%\n",
      "======分割线=======\n",
      "一周游玩时长低于 1100 分钟的玩家贡献：\n",
      "前七天平均付费金额为： 29.6782 付费总额为： 1483.91 贡献率为：0.121%\n",
      "45天平均付费金额为： 120.81959999999995 付费总额为： 6040.98 贡献率为：0.147%\n",
      "======分割线=======\n",
      "一周游玩时长低于 1200 分钟的玩家贡献：\n",
      "前七天平均付费金额为： 2.8692 付费总额为： 71.73 贡献率为：0.006%\n",
      "45天平均付费金额为： 25.492000000000004 付费总额为： 637.3 贡献率为：0.016%\n",
      "======分割线=======\n"
     ]
    }
   ],
   "source": [
    "# 查看游玩时长长玩家付费金额贡献\n",
    "for i in range(400,1300,100):\n",
    "    mean7 = train_data[train_data[\"在线时长\"] >= i][\"付费金额\"].mean()\n",
    "    mean45 = train_data[train_data[\"在线时长\"] >= i][\"45日付费金额\"].mean()\n",
    "    sum7 = train_data[train_data[\"在线时长\"] >= i][\"付费金额\"].sum()\n",
    "    sum45 = train_data[train_data[\"在线时长\"] >= i][\"45日付费金额\"].sum()\n",
    "    gx7 = sum7/(train_data[\"付费金额\"].sum())\n",
    "    gx45 = sum45/(train_data[\"45日付费金额\"].sum())\n",
    "    print(\"一周游玩时长低于\",i,\"分钟的玩家贡献：\")\n",
    "    print(\"前七天平均付费金额为：\",mean7,\"付费总额为：\",sum7,\"贡献率为：{:.3f}%\".format(gx7*100))\n",
    "    print(\"45天平均付费金额为：\",mean45,\"付费总额为：\",sum45,\"贡献率为：{:.3f}%\".format(gx45*100))\n",
    "    print(\"======分割线=======\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "a554138a-dfb1-4c23-ac89-f6dca646e3b4",
   "metadata": {},
   "source": [
    "* 在线时长大于800的贡献率大概为2%，可以将这部分定义为低质量用户"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ba636aa7-d6d9-4621-aef5-cb6760898a88",
   "metadata": {},
   "source": [
    "## 异常用户"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "id": "cfd2e94f-9a4d-4d86-ac4e-ecc37c59b3a0",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "# 打印异常比例，保存异常样本的索引 \n",
    "NumOfSamples = train_data.shape[0] \n",
    "abnormal = pd.DataFrame() \n",
    "DataNoAbnormal = train_data.copy() \n",
    "BoxAbnormalIdx = [] #列表：用于保存我们的异常值的索引 \n",
    "for idx,column in enumerate(train_data.columns[2:-1]): \n",
    "    feature = train_data.loc[:,column] \n",
    "    QL = np.quantile(feature,0.25) \n",
    "    QU = np.quantile(feature,0.75) \n",
    "    IQR = QU - QL \n",
    "    #过小或过大的都属于异常值 \n",
    "    error = feature[((feature < (QL - 1.5*IQR)).astype(int) + (feature > (QU + 1.5*IQR)).astype(int)) != 0] \n",
    "    BoxAbnormalIdx.extend(error.index) \n",
    "    abnormal.loc[idx,\"特征\"] = column \n",
    "    abnormal.loc[idx,\"异常值数量\"] = error.shape[0] \n",
    "    abnormal.loc[idx,\"异常值比例\"] = \"{:.3f}%\".format(error.shape[0]*100/NumOfSamples)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "id": "960c50a0-61ec-4944-acc8-539fb03f187f",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "BoxAbnormalIdx = list(set(BoxAbnormalIdx))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "id": "7426c24e-a5db-4f35-8585-d9a8f9a20c2c",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1123706"
      ]
     },
     "execution_count": 42,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(BoxAbnormalIdx)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "7a2c4cd9-4127-4c65-90a7-561dc480987f",
   "metadata": {},
   "source": [
    "* 超过一百万用户被标记为异常值"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "id": "e939c53e-7789-4a14-b3f7-8665b833d9b0",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>特征</th>\n",
       "      <th>异常值数量</th>\n",
       "      <th>异常值比例</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>39</th>\n",
       "      <td>建筑：联盟大厅等级</td>\n",
       "      <td>215420.000000</td>\n",
       "      <td>9.415%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>萨满损失数量</td>\n",
       "      <td>207173.000000</td>\n",
       "      <td>9.055%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>科研加速获取数量</td>\n",
       "      <td>195901.000000</td>\n",
       "      <td>8.562%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>萨满伤兵产生数量</td>\n",
       "      <td>183496.000000</td>\n",
       "      <td>8.020%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>84</th>\n",
       "      <td>科研：据点耐久</td>\n",
       "      <td>162146.000000</td>\n",
       "      <td>7.087%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>68</th>\n",
       "      <td>科研：神谕者</td>\n",
       "      <td>34.000000</td>\n",
       "      <td>0.001%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>69</th>\n",
       "      <td>科研：部队攻击</td>\n",
       "      <td>9.000000</td>\n",
       "      <td>0.000%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>94</th>\n",
       "      <td>科研：增援部队容量</td>\n",
       "      <td>3.000000</td>\n",
       "      <td>0.000%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>95</th>\n",
       "      <td>科研：行军大小</td>\n",
       "      <td>7.000000</td>\n",
       "      <td>0.000%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>96</th>\n",
       "      <td>科研：资源帮助容量</td>\n",
       "      <td>3.000000</td>\n",
       "      <td>0.000%</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>106 rows × 3 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "           特征         异常值数量   异常值比例\n",
       "39  建筑：联盟大厅等级 215420.000000  9.415%\n",
       "15     萨满损失数量 207173.000000  9.055%\n",
       "26   科研加速获取数量 195901.000000  8.562%\n",
       "20   萨满伤兵产生数量 183496.000000  8.020%\n",
       "84    科研：据点耐久 162146.000000  7.087%\n",
       "..        ...           ...     ...\n",
       "68     科研：神谕者     34.000000  0.001%\n",
       "69    科研：部队攻击      9.000000  0.000%\n",
       "94  科研：增援部队容量      3.000000  0.000%\n",
       "95    科研：行军大小      7.000000  0.000%\n",
       "96  科研：资源帮助容量      3.000000  0.000%\n",
       "\n",
       "[106 rows x 3 columns]"
      ]
     },
     "execution_count": 43,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "abnormal.sort_values(\"异常值比例\",ascending=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "id": "92058ec8-b93f-4fbd-a41a-a6aece026c36",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "41439"
      ]
     },
     "execution_count": 44,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#在异常用户中，付费用户的数量\n",
    "(train_data.loc[BoxAbnormalIdx,\"付费金额\"] != 0).sum() "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "id": "d01d1bcd-6e0e-4b03-a0de-75c1f05a1489",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "41439"
      ]
     },
     "execution_count": 45,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#所有7日付费用户数\n",
    "(train_data.loc[:,\"付费金额\"] != 0).sum() "
   ]
  },
  {
   "cell_type": "markdown",
   "id": "9e0b5c79-cb62-43aa-a6bc-81e458fbb9a0",
   "metadata": {},
   "source": [
    "- 全部付费用户都被归类为异常值\n",
    "- 后续建模需要特殊对待这些异常值"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "85ce83c0-90c9-42ec-8dac-2a564c880e94",
   "metadata": {},
   "source": [
    "# 数据建模"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "d0497e7f-202a-4415-9e1e-dba4f4d28392",
   "metadata": {},
   "source": [
    "## 划分数据集"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "id": "eae716b9-d337-400c-9a59-7dbedca7d9a2",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "X = train_data.drop([\"玩家唯一ID\",\"玩家注册时间\",\"45日付费金额\"],axis=1)\n",
    "Y = train_data[\"45日付费金额\"]\n",
    "x_train,x_test,y_train,y_test = train_test_split(X,Y,test_size=0.25,random_state=2024)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "id": "bc1a55ff-e28f-4476-8758-fd05074e3e7e",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "((1716005, 106), (572002, 106), (1716005,), (572002,))"
      ]
     },
     "execution_count": 47,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x_train.shape,x_test.shape,y_train.shape,y_test.shape"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "1164dd91-587d-48d6-93e4-9a57cc6c444c",
   "metadata": {},
   "source": [
    "## 模型训练"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "id": "d360e90f-2b4a-4888-b6b4-afcb9d475c52",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "线下回归的均方误差： 2855.0374523097935\n",
      "训练集R2： 0.5821403041524377\n",
      "测试集R2： 0.5602200315792131\n",
      "82.8011863231659\n"
     ]
    }
   ],
   "source": [
    "# 线性回归\n",
    "start = time.time()\n",
    "model = LinearRegression()\n",
    "model.fit(x_train,y_train)\n",
    "y_pred = model.predict(x_test)\n",
    "print(\"线下回归的均方误差：\",mean_squared_error(y_test,y_pred))\n",
    "print(\"训练集R2：\",model.score(x_train,y_train))\n",
    "print(\"测试集R2：\",model.score(x_test,y_test))\n",
    "end = time.time()\n",
    "print(end-start)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "id": "da00be23-15c8-4ad8-b663-d48f582ea7dc",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "决策树的均方误差： 7578.499618106568\n",
      "训练集R2： 0.9961938498007198\n",
      "测试集R2： -0.16736553491845751\n",
      "129.87407207489014\n"
     ]
    }
   ],
   "source": [
    "# 决策树\n",
    "start = time.time()\n",
    "model = DecisionTreeRegressor()\n",
    "model.fit(x_train,y_train)\n",
    "y_pred = model.predict(x_test)\n",
    "print(\"决策树的均方误差：\",mean_squared_error(y_test,y_pred))\n",
    "print(\"训练集R2：\",model.score(x_train,y_train))\n",
    "print(\"测试集R2：\",model.score(x_test,y_test))\n",
    "end = time.time()\n",
    "print(end-start)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ae966b07-4858-4c74-9384-f8a2075f5805",
   "metadata": {
    "tags": []
   },
   "source": [
    "- 初步判断，数据更适合线性模型\n",
    "- 而且如果使用树模型，机器运算能力要求太大，训练时间太长，需要考虑成本问题\n",
    "- 而且均方误差太大了"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "6c997663-caf4-44e2-b33e-42152a046776",
   "metadata": {},
   "source": [
    "## 特征工程"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "90f68078-728f-4ebb-bb74-efac9f013da6",
   "metadata": {},
   "source": [
    "- 方向一\n",
    "- 特征之间做四则运算\n",
    "- 对特征之间做逻辑运算\n",
    "- 对离散特征独热编码、连续特征离散化\n",
    "- 分组，根据某个离散特征为分组依据，对其他连续特征取做聚合操作"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "52c04ca2-37f4-4aac-8fa0-75257d8e3574",
   "metadata": {},
   "source": [
    "### 玩家操作相关"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "id": "72135b0c-c13d-4bef-808e-cf9567f8bb07",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array(['PVP次数', '主动发起PVP次数', 'PVP胜利次数', 'PVE次数', '主动发起PVE次数', 'PVE胜利次数',\n",
       "       '在线时长', '付费金额', '付费次数'], dtype=object)"
      ]
     },
     "execution_count": 50,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "train_data.columns[-10:-1].values"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "id": "e260e007-f0f8-4a40-b1d6-f688c776efda",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "train_data[\"PVP胜率\"] = train_data[\"PVP胜利次数\"] / train_data[\"PVP次数\"]\n",
    "train_data[\"PVP主动请战概率\"] = train_data[\"主动发起PVP次数\"] / train_data[\"PVP次数\"]\n",
    "train_data[\"PVP被挑战次数\"] = train_data[\"PVP次数\"] - train_data[\"主动发起PVP次数\"]\n",
    "train_data[\"PVP失败次数\"] = train_data[\"PVP次数\"] - train_data[\"PVP胜利次数\"]\n",
    "\n",
    "train_data[\"PVE胜率\"] = train_data[\"PVE胜利次数\"] / train_data[\"PVE次数\"]\n",
    "train_data[\"PVE主动请战概率\"] = train_data[\"主动发起PVE次数\"] / train_data[\"PVE次数\"]\n",
    "train_data[\"PVE被挑战次数\"] = train_data[\"PVE次数\"] - train_data[\"主动发起PVE次数\"]\n",
    "train_data[\"PVE失败次数\"] = train_data[\"PVE次数\"] - train_data[\"PVE胜利次数\"]\n",
    "\n",
    "train_data[\"玩家战斗次数\"] = train_data[\"PVP次数\"] + train_data[\"PVE次数\"]\n",
    "train_data[\"玩家胜利次数\"] = train_data[\"PVP胜利次数\"] + train_data[\"PVE胜利次数\"]\n",
    "train_data[\"每秒平均付费\"] = train_data[\"付费金额\"] / train_data[\"在线时长\"]\n",
    "train_data[\"玩家平均付费金额\"] = train_data[\"付费金额\"] / train_data[\"付费次数\"]"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e5782b5c-185f-4b99-af86-f382ecc2d410",
   "metadata": {},
   "source": [
    "### 游戏资源相关"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "id": "c25ff49b-cf36-4424-a3dd-711db772d848",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "MaterialCollection = [] # 材料收集\n",
    "ArmyRecruitment = [] # 军队运作\n",
    "MaterialConsumption = [] # 材料消耗\n",
    "BaseConstruction = [] # 基地建设\n",
    "SkillLearning = [] # 技能学习\n",
    "\n",
    "for col in train_data.columns:\n",
    "    if \"获取\" in col:\n",
    "        MaterialCollection.append(col)\n",
    "\n",
    "for col in train_data.columns:\n",
    "    if ((\"消耗\" in col) | (\"使用\" in col)) & (\"科研：\" not in col):\n",
    "        MaterialConsumption.append(col)\n",
    "        \n",
    "for col in train_data.columns:\n",
    "    if ((\"萨满\" in col) | (\"勇士\" in col) | (\"驯兽师\" in col)) & (\"科研：\" not in col):\n",
    "        ArmyRecruitment.append(col)\n",
    "        \n",
    "for col in train_data.columns:\n",
    "    if \"建筑：\" in col:\n",
    "        BaseConstruction.append(col)\n",
    "\n",
    "for col in train_data.columns:\n",
    "    if \"科研：\" in col:\n",
    "        SkillLearning.append(col)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "id": "fb319d15-ad58-423e-9257-b32402cc66c8",
   "metadata": {},
   "outputs": [],
   "source": [
    "train_data[\"材料收集效率\"] = train_data[MaterialCollection[:5]].mean(axis=1) / train_data[\"在线时长\"]\n",
    "train_data[\"道具收集效率\"] = train_data[MaterialCollection[5:]].mean(axis=1) / train_data[\"在线时长\"]\n",
    "train_data[\"材料消耗效率\"] = train_data[MaterialConsumption[:5]].mean(axis=1) / train_data[\"在线时长\"]\n",
    "train_data[\"道具消耗效率\"] = train_data[MaterialConsumption[5:]].mean(axis=1) / train_data[\"在线时长\"]\n",
    "train_data[\"军队运作效率\"] = train_data[ArmyRecruitment].mean(axis=1) / train_data[\"在线时长\"]\n",
    "train_data[\"基地建设效率\"] = train_data[BaseConstruction].mean(axis=1) / train_data[\"在线时长\"]\n",
    "train_data[\"技能学习效率\"] = train_data[SkillLearning].mean(axis=1) / train_data[\"在线时长\"]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "id": "ea189e07-44c0-481a-8e52-389ffb6484e4",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "count   2245197.000000\n",
       "mean               inf\n",
       "std                NaN\n",
       "min           0.000000\n",
       "25%           0.000000\n",
       "50%           0.000000\n",
       "75%           0.000000\n",
       "max                inf\n",
       "Name: 技能学习效率, dtype: float64"
      ]
     },
     "execution_count": 54,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "train_data[\"技能学习效率\"].describe()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "d54ca631-f1f0-474d-b6a8-74bf408d7b1e",
   "metadata": {},
   "source": [
    "- 当分母太小，分子太大就会出现极限值inf\n",
    "- 当分母为0，出现除0错误"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "id": "337b8d5b-8d60-47ef-8473-8736a2314408",
   "metadata": {},
   "outputs": [],
   "source": [
    "for col in train_data.columns[109:]:\n",
    "    train_data.loc[train_data[col].isna(),col] = 0\n",
    "    train_data.loc[train_data[col] == float(\"inf\"),col] = 0"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "1506f6c4-e761-4cd8-8a14-2824c34fdded",
   "metadata": {},
   "source": [
    "### 用户画像相关"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 56,
   "id": "f85a7b1c-574b-46ce-871e-662c245104eb",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "train_data[\"潜力用户\"] = (train_data[\"付费金额\"] >= 6).astype(int)\n",
    "train_data[\"好战用户\"] = (train_data[\"PVP主动请战概率\"] > 0.5).astype(int)\n",
    "train_data[\"零氪用户\"] = ((train_data[\"付费金额\"] == 0) & (train_data[\"在线时长\"] > 15)).astype(int)\n",
    "train_data[\"流失用户\"] = ((train_data[\"在线时长\"] <= 15) & (train_data[\"木头获取数量\"] <= 10000)).astype(int)\n",
    "train_data[\"肝帝\"] = (train_data[\"在线时长\"] >= 800).astype(int)\n",
    "train_data[\"熟客\"] = (train_data[\"付费次数\"] > 1).astype(int)\n",
    "train_data[\"囤货用户\"] = (train_data[\"材料收集效率\"] > 2*train_data[\"材料消耗效率\"]).astype(int)\n",
    "train_data[\"休闲用户\"] = (((train_data[\"PVP主动请战概率\"] <= 0.2) | (train_data[\"PVP次数\"] == 0)) & (train_data[\"在线时长\"] >= 15)).astype(int)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "12469ae9-eea9-440a-8563-5e75918f63d2",
   "metadata": {},
   "source": [
    "- 方向二\n",
    "- 改变数据形态（包括：统一量纲、划分数据集比例、数据正态化处理）"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "fbfa59e7-e04a-4055-af75-66fc7478b9b7",
   "metadata": {},
   "source": [
    "### 划分数据集"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "id": "569bd5fe-27c6-4f8f-bce1-ecdcaf004ce2",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "X# 划分数据集\n",
    "X = train_data.drop([\"玩家唯一ID\",\"玩家注册时间\",\"45日付费金额\"],axis=1)\n",
    "Y = train_data[\"45日付费金额\"]\n",
    "x_train,x_test,y_train,y_tesr = train_test_split(X,Y,test_size=0.25,shuffle=True)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "05f02000-619d-4a25-8c76-75ee3dfe37b3",
   "metadata": {},
   "source": [
    "### 异常值处理"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "id": "0a1af7e0-cdc1-40df-9949-91e590631b5c",
   "metadata": {},
   "outputs": [],
   "source": [
    "def myfunc():\n",
    "    for col in x_train.columns:\n",
    "        QU = x_train[col].quantile(0.75)\n",
    "        QL = x_train[col].quantile(0.25)\n",
    "        IQR = QU - QL\n",
    "        UP = QU + 1.5 * IQR\n",
    "        LOW = QL - 1.5 * IQR\n",
    "        trainerror = ((x_train[col] < LOW) | (x_train[col] > UP)) & (x_train[\"付费次数\"] == 0)\n",
    "        testerror = ((x_test[col] < LOW) | (x_test[col] > UP)) & (x_test[\"付费次数\"] == 0)\n",
    "        x_train.loc[trainerror,col] = 0\n",
    "        x_test.loc[testerror,col] = 0"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 60,
   "id": "ed19ce98-3e08-4aa1-8bdd-f3c3bcc96cd7",
   "metadata": {},
   "outputs": [],
   "source": [
    "myfunc()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "aa9c9abb-47f3-4cf9-8b12-50bf32bdb1c0",
   "metadata": {},
   "source": [
    "### 数据归一化"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 62,
   "id": "1795ea29-6c21-474d-8fe9-d091c078d298",
   "metadata": {},
   "outputs": [],
   "source": [
    "mms = MinMaxScaler()\n",
    "mms.fit(x_train)\n",
    "x_train_mms = mms.transform(x_train)\n",
    "x_test_mms = mms.transform(x_test)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ba19fa0e-85ed-49ad-be9f-2382702972df",
   "metadata": {},
   "source": [
    "# 再次建模"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 65,
   "id": "0cfac296-6383-47fd-a0b8-9dc4ee253dd2",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "线下回归的均方误差： 10806.550549250605\n",
      "训练集R2： -2.3535484346356038e+21\n",
      "测试集R2： -2.328912532202578e+21\n",
      "95.48740458488464\n"
     ]
    }
   ],
   "source": [
    "# 线性回归\n",
    "start = time.time()\n",
    "model = LinearRegression()\n",
    "model.fit(x_train_mms,y_train)\n",
    "y_pred = model.predict(x_test_mms)\n",
    "print(\"线下回归的均方误差：\",mean_squared_error(y_test,y_pred))\n",
    "print(\"训练集R2：\",model.score(x_train,y_train))\n",
    "print(\"测试集R2：\",model.score(x_test,y_test))\n",
    "end = time.time()\n",
    "print(end-start)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 66,
   "id": "47ae37bb-b237-4046-92b4-8e26844586e5",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "决策树的均方误差： 16240.676453313088\n",
      "训练集R2： -448.15639894171665\n",
      "测试集R2： -573.2514746658244\n",
      "92.78782749176025\n"
     ]
    }
   ],
   "source": [
    "# 线性回归\n",
    "start = time.time()\n",
    "model = DecisionTreeRegressor()\n",
    "model.fit(x_train_mms,y_train)\n",
    "y_pred = model.predict(x_test_mms)\n",
    "print(\"决策树的均方误差：\",mean_squared_error(y_test,y_pred))\n",
    "print(\"训练集R2：\",model.score(x_train,y_train))\n",
    "print(\"测试集R2：\",model.score(x_test,y_test))\n",
    "end = time.time()\n",
    "print(end-start)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "22619125-f66a-4d41-98b5-1d1d6a68f9df",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "7ec4e731-fb01-4210-a13e-ed342aad4ccb",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.12"
  },
  "toc-autonumbering": true
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
